package com.huidatech.mpgdemo.crawler_unit.task;

import com.huidatech.mpgdemo.crawler_unit.CrawlerForPriceService;
import lombok.SneakyThrows;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

/**
 * @Description:
 * 下午16点爬取
 * ● 广东江门市水产冻品副食批发市场最新批发报价 https://price.21food.cn/market/817.html 至多爬取2页 【16点】
 * @Author: Wangzz
 * @Version: 1.0.0
 * @CreateDate: Created in 2021/10/25 9:59
 * @UpdateDate: [dateFormat:YYYY-MM-DD][modifier][description]
 */

@Component
public class AM16Task extends QuartzJobBean {

    @Autowired
    private CrawlerForPriceService cfpService;

    @SneakyThrows
    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        System.out.println(" ===============================【下午16点爬取 start】=============================");
        System.out.println("广东江门市水产冻品副食批发市场最新批发报价 https://price.21food.cn/market/817.html");
        String urlOriginalSeed = "https://price.21food.cn/market/817.html";
        cfpService.executeCrawlerProgram(urlOriginalSeed);
        System.out.println(" ===============================【下午16点爬取 end】===============================");
    }
}
